<template>
  <div class="recommend">
    <div class="recommen-title">热销推荐</div>
      <ul>
        <router-link tag="li" :to="'/detail/' + item.id" class="recommen-item border-bottom" v-for="item in list" :key="item.id">
          <img class="recommen-img" :src="item.imgUrl" alt />
          <div class="recommen-info">
            <p class="recommen-head">{{item.title}}</p>
            <p class="recommen-desc">{{item.desc}}</p>
            <button class="recommen-btn">查看详情</button>
          </div>
        </router-link>
      </ul>
  </div> 
</template>

<script>
export default {
  name: "HomeRecommend",
  props: {
    list: Array
  }
  // data() {
  //   return {
  //       recommendList:[
  //           {
  //               id:'001',
  //               imgUrl:'https://tr-osdcp.qunarzz.com/tr-osd-tr-manager/img/646e244028cb286586e2cb0aa9dd63dc.jpg',
  //               head: '大连圣亚海洋世界',
  //               desc:'浪漫大连首战,浪漫的海洋主题乐园'
  //           },
  //           {
  //               id:'002',
  //               imgUrl:'https://tr-osdcp.qunarzz.com/tr-osd-tr-manager/img/646e244028cb286586e2cb0aa9dd63dc.jpg',
  //               head: '大连圣亚海洋世界',
  //               desc:'浪漫大连首战,浪漫的海洋主题乐园'
  //           },
  //           {
  //               id:'003',
  //               imgUrl:'https://tr-osdcp.qunarzz.com/tr-osd-tr-manager/img/646e244028cb286586e2cb0aa9dd63dc.jpg',
  //               head: '大连圣亚海洋世界',
  //               desc:'浪漫大连首战,浪漫的海洋主题乐园'
  //           },
  //       ]
  //   };
  // }
};
</script>

<style lang='less' scoped>
.recommen-title {
  margin-top: 0.2rem;
  background: #eee;
  line-height: 0.8rem;
  text-indent: 0.2rem;
}
.recommen-item {
  overflow: hidden;
  display: flex;
  height: 1.9rem;
  //   background: red;
  .recommen-img {
    width: 1.7rem;
    height: 1.7rem;
    padding: 0.1rem;
  }
  .recommen-info {
    flex: 1;
    min-width: 0;
    padding: 0.1rem;
    .recommen-head {
      line-height: 0.54rem;
      font-size: 0.32rem;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
    .recommen-desc {
      line-height: 0.4rem;
      color: #ccc;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
    .recommen-btn {
      margin-top: 0.1rem;
      background: #ff9300;
      padding: 0.1rem;
      border-radius: 0.06rem;
      color: #fff;
    }
  }
}
</style>
